Skip to content

Stop the legacy login poll when the user clicks Deny - #22

Merged
svincent240 merged 1 commit into
mainfrom
fix/legacy-login-deny
Dec 2, 2026
Merged

svincent240 merged 1 commit into
mainfrom
fix/legacy-login-deny

Conversation

@svincent240

Copy link
Copy Markdown
Contributor

What

The browser (nonce) login fallback in lib/cloud.js treated CourseCode Cloud's 400 Denied poll response like a transient error and kept polling until the 15-minute timeout. It now exits right away with:

Login was denied in the browser. Run coursecode login to try again.

This matches how the device-code login flow already handles a 400.

When it matters

The fallback only runs when Cloud has no device-code login (/api/auth/device returns 404). Current Cloud has device-code login, so this is rarely hit. The fallback could be removed in a later change.

Tests

  • New test in tests/lib/cloud-auth.test.js: a Deny during the fallback exits, stops polling, and writes no credentials. It fails without the fix.
  • npm test: 1,699 passed. Lint clean.
  • CHANGELOG.md: Fixed entry under Unreleased.

🤖 Generated with Claude Code

The browser (nonce) login fallback treated Cloud's 400 "Denied" poll
response like a transient error and kept polling until the 15-minute
timeout. It now exits with a clear message, matching the device-code flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@svincent240
svincent240 merged commit 392b94f into main Dec 2, 2026
3 checks passed
@svincent240
svincent240 deleted the fix/legacy-login-deny branch December 2, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant